package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OldFoodServiceMapper;
import com.ruoyi.system.domain.OldFoodService;
import com.ruoyi.system.service.IOldFoodServiceService;

/**
 * 社区养老订餐Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-05
 */
@Service
public class OldFoodServiceServiceImpl implements IOldFoodServiceService 
{
    @Autowired
    private OldFoodServiceMapper oldFoodServiceMapper;

    /**
     * 查询社区养老订餐
     * 
     * @param id 社区养老订餐ID
     * @return 社区养老订餐
     */
    @Override
    public OldFoodService selectOldFoodServiceById(Long id)
    {
        return oldFoodServiceMapper.selectOldFoodServiceById(id);
    }

    /**
     * 查询社区养老订餐列表
     * 
     * @param oldFoodService 社区养老订餐
     * @return 社区养老订餐
     */
    @Override
    public List<OldFoodService> selectOldFoodServiceList(OldFoodService oldFoodService)
    {
        return oldFoodServiceMapper.selectOldFoodServiceList(oldFoodService);
    }

    /**
     * 新增社区养老订餐
     * 
     * @param oldFoodService 社区养老订餐
     * @return 结果
     */
    @Override
    public int insertOldFoodService(OldFoodService oldFoodService)
    {   oldFoodService.setOldCreatetime(DateUtils.getNowDate());
        return oldFoodServiceMapper.insertOldFoodService(oldFoodService);
    }

    /**
     * 修改社区养老订餐
     * 
     * @param oldFoodService 社区养老订餐
     * @return 结果
     */
    @Override
    public int updateOldFoodService(OldFoodService oldFoodService)
    {

        return oldFoodServiceMapper.updateOldFoodService(oldFoodService);
    }

    /**
     * 批量删除社区养老订餐
     * 
     * @param ids 需要删除的社区养老订餐ID
     * @return 结果
     */
    @Override
    public int deleteOldFoodServiceByIds(Long[] ids)
    {
        return oldFoodServiceMapper.deleteOldFoodServiceByIds(ids);
    }

    /**
     * 删除社区养老订餐信息
     * 
     * @param id 社区养老订餐ID
     * @return 结果
     */
    @Override
    public int deleteOldFoodServiceById(Long id)
    {
        return oldFoodServiceMapper.deleteOldFoodServiceById(id);
    }
}
